package com.jrx.anytxn.feign.transaction.service;

import com.jrx.anytxn.feign.transaction.request.DealCustBatchReq;
import com.jrx.anytxn.feign.transaction.request.EtlSettleReq;
import com.jrx.anytxn.feign.transaction.request.GlInterfaceReq;
import com.jrx.anytxn.feign.transaction.request.BillReq;
import com.jrx.anytxn.feign.transaction.request.SendSmsReq;
import com.jrx.anytxn.feign.transaction.response.AllRemainBillQueryRes;
import com.jrx.anytxn.feign.transaction.response.EtlSettleRes;
import com.jrx.anytxn.feign.transaction.response.GlInterfaceRes;
import com.jrx.anytxn.i18n.response.TxnRespResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

@FeignClient(name = "anytxn-cf-transaction-api")
public interface IAnyTxnTransactionService {

    /**
     * 合作方额度调整
     *
     * @param req 合作方额度调整请求实体
     * @return TxnRespResult<PartnerLimitAdjustmentRes> 合作方额度调整返回实体
     */
    @PostMapping(value = "/api/transaction/gl/buildTlGlInterfaceInfo", consumes = "application/json;charset=UTF-8")
    TxnRespResult<GlInterfaceRes> buildTlGlInterfaceInfo(GlInterfaceReq req);

    /**
     * 客户日终账户处理
     *
     * @param req 客户日终账户处理请求实体
     * @return TxnRespResult
     * @author liuyang
     * @date 2020-09-15
     */
    @PostMapping(value = "/api/transaction/CustBatch/dealCustBatch", consumes = "application/json;charset=UTF-8")
    TxnRespResult dealCustBatch(DealCustBatchReq req);

    /**
     * 短信发送
     *
     * @param req 短信发送请求实体
     * @return TxnRespResult
     * @author zebin.zhang
     * @date 2022-02-23
     */
    @PostMapping(value = "/api/transaction/sendSms/sendSms", consumes = "application/json;charset=UTF-8")
    TxnRespResult sendSms(SendSmsReq req);

    /**
     * 结清日期查询
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/api/transaction/repayment/getEtlSettleDate", consumes = "application/json;charset=UTF-8")
    TxnRespResult<EtlSettleRes> getEtlSettleDate(EtlSettleReq req);

    /**
     * 待还账单查询
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/api/transaction/loan/allRemainBillQuery", consumes = "application/json")
    TxnRespResult<AllRemainBillQueryRes> allRemainBillQuery(@RequestBody BillReq req);

    /**
     * 查询是否用信过
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/api/transaction/loan/queryLoanRecord", consumes = "application/json")
    TxnRespResult<Boolean> queryLoanRecord(@RequestBody BillReq req);

    /**
     * getLoanTotalAmount
     *
     * @param channel
     * @param customerId
     * @param tenantId
     * @param productId
     */
    @GetMapping(value = "/api/transaction/loan/getLoanTotalAmount", consumes = "application/json")
    TxnRespResult<BigDecimal> getLoanTotalAmount(@RequestParam("channel") String channel,
                                                 @RequestParam("customerId") String customerId,
                                                 @RequestParam("tenantId") String tenantId,
                                                 @RequestParam("productId") String productId);
}
